import request from '@/utils/request'

export const wareHouseApi = (params) => {
  return request({
    url: '/api/warehouse/page',
    params
  })
}

// 删除
export const delWare = (id) => {
  return request({
    url: `/api/warehouse`,
    method: 'DELETE',
    params: {
      'ids[]': id
    }
  })
}
// 点击启用停用
export const openApi = (data) => {
  return request({
    url: '/api/warehouse',
    method: 'PUT',
    data
  })
}

// 点击新增获取ck
export const getCkApi = () => {
  return request({
    url: '/api/codeFactory/next/CK'
  })
}

// 点击新增
export const submitApi = (data) => {
  return request({
    url: '/api/warehouse',
    method: 'POST',
    data
  })
}

// 根据id获取仓库信息
export const getdetauksApi = (id) => {
  return request({
    url: `/api/warehouse/${id}`
  })
}

// 点击修改
export const editApi = (data) => {
  return request({
    url: '/api/warehouse',
    method: 'PUT',
    data
  })
}
